 <?
 include("../connect.php");
$sql = "SELECT SUBSTRING(COLUMN_TYPE,3)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA='db_itmanager' 
    AND TABLE_NAME='permissionfile'
    AND COLUMN_NAME='per_permission' ";
$result = mysql_query($sql) or die( 'error getting enum field ' . mysql_error() );
$row = mysql_fetch_array($result);
$regex = "/'(.*?)'/";
preg_match_all( $regex , $row[0], $enum_array );
$enum_fields = $enum_array[0];

echo $enum_fields[0];
			?>